*Paper: Fiscal Rules, Corruption and Electoral Accountability - Replication Files

clear all
cap log close 
set more off


**Global files
global folder "/Users/tommasogiommoni/Dropbox/Determinants of corruption/Stability pact and corruption/Replication files JOP"


********************************************************************************
****----						Dataset open 					    	----**** 
********************************************************************************

use "$folder/Data/dataset_feb2024.dta", clear

**-- Global

global controls7 proportion_female_Elected_lag av_education_Elected_lag av_age_Elected_lag  victory_margin_lag term_limit_lag 
global controls7_int  c.proportion_female_Elected_lag##i.anno c.av_education_Elected_lag##i.anno c.av_age_Elected_lag##i.anno c.victory_margin_lag##i.anno  c.term_limit_lag##i.anno

**-- Panel dataset

xtset codcom anno
fvset base 2012 anno

********************************************************************************
****----						Analysis 					    		----**** 
********************************************************************************

**-- Italy
qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store sample1

qui reghdfe corruption_PC_sd S##T P i.anno 						 if _est_sample1==1 & abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)   
est store tab1_1
qui reghdfe corruption_PC_sd S##T P i.anno $controls7 		     if _est_sample1==1 & abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)
est store tab1_2
qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if _est_sample1==1 & abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store tab1_3
qui reghdfe corruption_exp_log_sd S##T P i.anno 						 if _est_sample1==1 & abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)   
est store tab1_4
qui reghdfe corruption_exp_log_sd S##T P i.anno $controls7 		     if _est_sample1==1 & abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)
est store tab1_5
qui reghdfe corruption_exp_log_sd S##T P i.region_year $controls7_int if _est_sample1==1 & abs(P)<2500 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store tab1_6

**-- Nord
qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store sample2

qui reghdfe corruption_PC_sd S##T P i.anno 						 if _est_sample2==1 & abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)   
est store tab2_1
qui reghdfe corruption_PC_sd S##T P i.anno $controls7 		     if _est_sample2==1 & abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)
est store tab2_2
qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if _est_sample2==1 & abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store tab2_3
qui reghdfe corruption_exp_log_sd S##T P i.anno 						 if _est_sample2==1 & abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)   
est store tab2_4
qui reghdfe corruption_exp_log_sd S##T P i.anno $controls7 		     if _est_sample2==1 & abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)
est store tab2_5
qui reghdfe corruption_exp_log_sd S##T P i.region_year $controls7_int if _est_sample2==1 & abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store tab2_6

**-- Sud
qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store sample3

qui reghdfe corruption_PC_sd S##T P i.anno 						 if _est_sample3==1 & abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)   
est store tab3_1
qui reghdfe corruption_PC_sd S##T P i.anno $controls7 		     if _est_sample3==1 & abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)
est store tab3_2
qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if _est_sample3==1 & abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store tab3_3
qui reghdfe corruption_exp_log_sd S##T P i.anno 						 if _est_sample3==1 & abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)   
est store tab3_4
qui reghdfe corruption_exp_log_sd S##T P i.anno $controls7 		     if _est_sample3==1 & abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom ) vce(cluster codcom)
est store tab3_5
qui reghdfe corruption_exp_log_sd S##T P i.region_year $controls7_int if _est_sample3==1 & abs(P)<2500 & FURs==1 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA"), absorb(codcom) vce(cluster codcom)
est store tab3_6

**-- Table

esttab tab2_1 tab2_2 tab2_3 tab2_4 tab2_5 tab2_6, compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace
esttab tab2_1 tab2_2 tab2_3 tab2_4 tab2_5 tab2_6 using "$folder/Tables/Table1_a.tex", compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace

esttab tab3_1 tab3_2 tab3_3 tab3_4 tab3_5 tab3_6, compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace
esttab tab3_1 tab3_2 tab3_3 tab3_4 tab3_5 tab3_6 using "$folder/Tables/Table1_b.tex", compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace

esttab tab1_1 tab1_2 tab1_3 tab1_4 tab1_5 tab1_6, compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace
esttab tab1_1 tab1_2 tab1_3 tab1_4 tab1_5 tab1_6 using "$folder/Tables/Table1_c.tex", compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace
